package online.flowerinsnow.minecraft.bukkit.testffa.event;

import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;

/**
 * 当玩家战斗状态改变时触发
 */
public class PlayerCombatStateChangeEvent extends Event {
    public static final HandlerList HANDLER_LIST = new HandlerList();

    /**
     * 玩家
     */
    @NotNull public final Player player;
    /**
     * 变更到的战斗状态
     */
    @NotNull public final EnumCombatState toState;

    public PlayerCombatStateChangeEvent(@NotNull Player player, @NotNull EnumCombatState toState) {
        this.player = player;
        this.toState = toState;
    }

    @Override
    public HandlerList getHandlers() {
        return HANDLER_LIST;
    }
    public static HandlerList getHandlerList() {
        return HANDLER_LIST;
    }

    public enum EnumCombatState {
        /**
         * 战斗状态
         */
        IN_COMBAT,
        /**
         * 空闲状态
         */
        FREE
    }
}
